using System; namespace Shared.SimpleControl.Phone { public class DoorLockUserMangement : FrameLayout { DoorLock tempDoorLock; public DoorLockUserMangement (DoorLock door_lock) { this.tempDoorLock = door_lock; BackgroundColor = SkinStyle.Current.MainColor; } public void ShowUserManagement () { #region 标题 var topView = new FrameLayout () { Y = Application.GetRealHeight (36), Height = Application.GetRealHeight (90), BackgroundColor = SkinStyle.Current.MainColor, }; AddChidren (topView); var title = new Button () { TextAlignment = TextAlignment.Center, TextID = R.MyInternationalizationString.UserManagement , TextSize = 19, TextColor = SkinStyle.Current.TextColor1, }; topView.AddChidren (title); var logo = new Button () { Width = Application.GetRealWidth (154), Height = Application.GetRealHeight (90), X = Application.GetRealWidth (486), UnSelectedImagePath = MainPage.LogoString, Gravity = Gravity.CenterVertical, }; topView.AddChidren (logo); var back = new Button () { Height = Application.GetRealHeight (90), Width = Application.GetRealWidth (85), UnSelectedImagePath = "Item/Back.png", SelectedImagePath = "Item/BackSelected.png", Gravity = Gravity.CenterVertical, }; topView.AddChidren (back); back.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent (); }; #endregion #region BodyView var BodyView = new VerticalScrolViewLayout () { Y = topView.Bottom, Height = Application.GetRealHeight (Application.DesignHeight - 126), BackgroundColor = SkinStyle.Current.ViewColor, }; AddChidren (BodyView); for (int i = 0; i < 3; i++) { FrameLayout RowView = new FrameLayout () { Height = Application.GetRealHeight (110), BackgroundColor = SkinStyle.Current.ViewColor, }; BodyView.AddChidren (RowView); var btnIcon = new Button () { Width = Application.GetRealHeight (13), Height = Application.GetRealHeight (13), X = Application.GetRealWidth (40), UnSelectedImagePath = "Item/Point.png", SelectedImagePath = "Item/PointSelected.png", Gravity = Gravity.CenterVertical, }; RowView.AddChidren (btnIcon); var UnEditedItem = new Button () { X = btnIcon.Right + Application.GetRealWidth (20), Width = Application.GetRealWidth (300), Height = Application.GetRealHeight (110), TextAlignment = TextAlignment.CenterLeft, TextColor = SkinStyle.Current.TextColor1, }; RowView.AddChidren (UnEditedItem); if (i == 0) { UnEditedItem.TextID = R.MyInternationalizationString.UneditFingerprint; } else if (i == 1) { UnEditedItem.TextID = R.MyInternationalizationString.PasswordList; } else if (i == 2) { UnEditedItem.TextID = R.MyInternationalizationString.ProximityCard; } var btnRight = new Button () { Width = Application.GetRealWidth (28), Height = Application.GetRealHeight (40), X = UnEditedItem.Right + Application.GetRealWidth (200), UnSelectedImagePath = "Item/Right.png", SelectedImagePath = "Item/RightSelected.png", Gravity = Gravity.CenterVertical, }; RowView.AddChidren (btnRight); var line2 = new Button () { Y = Application.GetRealHeight (107), Height = Application.GetRealHeight (3), BackgroundColor = SkinStyle.Current.TitileView, }; RowView.AddChidren (line2); int currentIndex = i; EventHandler eHandler = (sender, e) => { if (currentIndex == 0) { new FingerPrint (tempDoorLock).Show (); } else if (currentIndex == 1) { PasswordList passwordListView = new PasswordList (tempDoorLock); UserMiddle.DevicePageView.AddChidren (passwordListView); passwordListView.ShowUserPasswordPrint (); UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1; } else if (currentIndex == 2) { new ProximityCard (tempDoorLock).Show (); } }; btnRight.MouseUpEventHandler += eHandler; btnIcon.MouseUpEventHandler += eHandler; RowView.MouseUpEventHandler += eHandler; UnEditedItem.MouseUpEventHandler += eHandler; } #endregion } } }